package com.china08.yxyapi.repository.db;

import java.util.List;

import org.springframework.data.elasticsearch.annotations.Query;
import org.springframework.data.jpa.repository.JpaRepository;

import com.china08.yxyapi.entity.db.sws.SwsSetting;

public interface SwsSettingRepository extends JpaRepository<SwsSetting, String> {

    SwsSetting findBySchoolId(String schoolId);

    @Query(value = " select t from SwsSetting where schoolId = ?1 ")
    List<SwsSetting> findBySchoolIdAndSchoolIdNotNull(String schoolId);

    @Override
    @Query(value = "select t1 from SwsSetting t1,SwsSettingDomains t2 where t1.schoolId = t2.schoolId and t2.domainName is not null ")
    List<SwsSetting> findAll();
}
